<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty Fix time
 *
 * Type:     modifier<br>
 * Name:     Fix time<br>
 * Purpose:  Fix time
 * @link http://smarty.php.net/manual/en/language.modifier.nl2br.php
 *          nl2br (Smarty online manual)
 * @version  1.0
 * @author   Monte Ohrt <monte at ohrt dot com>
 * @param string
 * @return string
 */
 

function smarty_modifier_fixtime($string)
{
	
	
	$time = $string;
$pi = explode(" ", $time);

$pi_time = explode(":", $pi[0]);

if(($pi[1] == 'pm' or $pi[1] == 'PM') && ($pi_time[0] == '12')){
	
	$time = str_replace(":","",$pi[0]);

	return $time;
	
}elseif(($pi[1] == 'pm' or $pi[1] == 'PM' ) or (($pi[1] == 'am' or $pi[1] == 'AM') &&  ($pi_time[0] == '12'))){
	$time1 = str_replace(":","",$pi[0]);

	$time = $time1 + 1200;
	return $time;
	
}else{
	
	$time = str_replace(":","",$pi[0]);
		return $time;
	
}

	
    
}

?>
